<template>
    <lightning-card
        title="ApexWireMethodToFunction"
        icon-name="custom:custom63"
    >
        <div class="slds-var-m-around_medium">
            <template lwc:if={contacts}>
                <template for:each={contacts} for:item="contact">
                    <p key={contact.Id}>{contact.Name}</p>
                </template>
            </template>
            <template lwc:elseif={error}>
                <c-error-panel errors={error}></c-error-panel>
            </template>
        </div>

        <c-view-source source="lwc/apexWireMethodToFunction" slot="footer">
            Call an Apex method that retrieves a list of records using @wire. In
            this recipe, the Apex method is @wired to a component function.
        </c-view-source>
    </lightning-card>
</template>
